package main.java.com.suncuicui.bi.FactoryMode.vo;

/**
 * Created by suncuicui on 2018/11/28.
 */
public class SingletonHungry {
    /**
     * 饿汉式
     * 优点：没有加锁，执行效率会提高。
      缺点：类加载时就初始化，浪费内存。
     * */
    private static SingletonHungry instance = new SingletonHungry();
    private SingletonHungry (){}
    public static SingletonHungry getInstance() {
        return instance;
    }
}
